package com.jisf.driver.controller;

import com.jisf.driver.entity.po.Chat;
import com.jisf.driver.response.Result;
import com.jisf.driver.service.IChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jisf
 * @since 2022-05-06
 */
@RestController
@RequestMapping("/driver/chat")
public class ChatController {

    @Autowired
    private IChatService iChatService;

    @GetMapping("chatRecords")
    public Result<?> chatRecords(@RequestParam Integer id){
        List<Chat> chats = iChatService.chatRecords(id);
        return Result.ok(chats);
    }

}
